<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page isELIgnored="false" %>
<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8"/>
    <meta name="description" content="人生就是一部小说,记录生活的点滴" />
    <meta name="keywords" content="记录生活,小说人说,分享你的生活动态,订阅他人的分享" />
    <script>
    window._time = [Date.now()];
    </script>
    <link rel="stylesheet" href="/faceb-cupt/css/reset.min.css" />
    <link rel="stylesheet" href="/faceb-cupt/css/index.min.css" />
    <link rel="stylesheet" href="/faceb-cupt/util/font-awesome-3.2.1/css/font-awesome.min.css" />
    <style type="text/css">
    .poa {
        position: relative;
    }
    
    .personal-box {
        position: absolute;
        top: 53px;
        right: 0px;
        width: 108px;
        height: 80px;
        border-radius: 10px;
        background: #10d0d8;
        overflow: hidden;
    }
    
    .personal-box a {
        display: block;
        margin: 0px auto;
        padding: 0;
        color: #fff;
        text-align: center;
        border-radius: 0;
    }
    
    .personal-box a.btn {
        height: 40px;
        border: 0;
        background: #10d0d8;
        color: #fff;
        font-size: 16px;
    }
    
    .personal-box a:hover {
        background: #fff;
        color: #10d0d8;
    }
    
    .hide {
        opacity: 0;
    }
    
    .trans {
        -webkit-transition: all 1s;
        -o-transition: all 1s;
        transition: all 1s;
    }
    a.author{
    font-size:17px !important;
    font-weight:bold;
    }
    </style>
    <title>记录生活的点滴</title>
</head>

<body>
    <script>
    window._time[1] = Date.now();
    </script>
    <div class="page-header clearfix">
        <h1 class="page-header-title pull-left">${user.u_info}</h1>
        <div class="page-header-personal pull-right poa js-header">
            <a href="javascript:void(0)" class="personal-photo">
                <span class="name js-loginid" data-id="${user.u_id }">${user.u_name}</span>
                <img src="http://172.18.106.98:8080/faceb-cupt/userlogo/users/${user.u_id }" alt="test" />
            </a>
            <div class="personal-box hide trans">
                <a href="/faceb-cupt/tpl/profile" class="btn">我的资料</a>
                <a href="javascript:void(0)" class="btn">退出登陆</a>
            </div>
        </div>
    </div>
    <div class="page-aside">
        <ul class="navbar">
            <li>
                <a href="/faceb-cupt/tpl/index" class="home">
                    <i class="icon-home"></i>
                </a>
                <a href="javascript:void(0)" class="js-center">
                    <i class="icon-user"></i>
                </a>
            </li>
        </ul>
    </div>
    <div class="page-content clearfix">
        <div class="article pull-left">
            <div id="article-content">
            </div>
            <div class="article-total-footer">
                <a href="javascript:void(0)" class="btn btn-load" id="btn-load">加载更多</a>
            </div>
        </div>
        <div class="recommend">
            <div class="labels">
                <a href="javascript:void(0)" class="label">最新</a>
                <a href="javascript:void(0)" class="label">最热门</a>
                <a href="javascript:void(0)" class="label">北京</a>
                <a href="javascript:void(0)" class="label">人这辈子</a>
                <a href="javascript:void(0)" class="label">快乐</a>
                <a href="javascript:void(0)" class="label">没救</a>
            </div>
        </div>
    </div>
    <div id="tests"></div>
</body>
<script src="/faceb-cupt/js/lib/require.js"></script>
<script>
window.onload = function() {
    window._time[2] = Date.now();
};
requirejs.config({
    baseUrl: '/faceb-cupt/js',
    paths: {
        jquery: 'lib/jq'
    }
})
require(['page/index'], function(index) {
    index.init();
})
</script>
<script type="text/javascript">
var isBottom = function() {
    var $window = $(window);
    if ($window.scrollTop() + $window.height() == $(document).height()) {
        return true;
    }
    return false;

}
</script>
<script type="text/javascript">
var basePath = "http://120.26.75.87/faceb-cupt/newsafter/time/1/count/10";
var app = {
    init: function() {

        this.render();
        this.bindEvent();
    },
    render: function() {


    },
    bindEvent: function() {

    },
    getRemoteData: function(url, method) {
        //var result;
        $.ajax({
            type: method,
            url: url,
            data: {},
            dataType: "json"
        }).done(function(data) {
            console.log(data);
        });

    }

}
</script>

<script type="text/html" id="article-index-tpl">
    <?? for(var i =0,length=data.length;i< length;i++){
    var news=data[i]["news"];
    var pics=data[i]["pics"];
    var comments=data[i]["comments"];
   ??>
        <div class="article-item clearfix" data-nid=<??=news['n_id']??> data-nuid="<??=news['n_u_id']??>">
            <div class="intro pull-left nidway" data-nid=<??=news["n_id"]??>>
                <div class="article-author">
                    <a class="author js-author" href="javascript:void(0)" data-uid=<??=news['n_u_id']??> ><??= news["u_name"]??></a>
                    <span class="time"><??=news["n_time"]??></span>
                </div>
                <a href="javascript:void(0)" class="article-title">
                    <h1 class="js-godetail " data-uid="<??= news["n_u_id"]??>" data-nid=<??=news["n_id"]??>><??=news["n_content"]??></h1>
                </a>
                <div class="article-footer">
                    <a href="javascript:void(0)" class="read">
                        <??=news["n_viewcount"]??>阅读</a>
                    <a href="javascript:void(0)" class="comment">
                        <??= comments.length??>评论</a>
                    <a href="javascript:void(0)" class="like js-elike"  data-like=<??= news["n_like"]??> >
                        <??=news["n_like"]??>喜欢</a>
                </div>
            </div>
            <div class="photo pull-right">
                <?? if(pics.length > 0){??>
                    <img src="<??= pics[0]['np_path'] ??>" alt="test" />
                    <??}??>
            </div>
        </div>
        <?? }??>
</script>


</html>
